﻿Public Class Hash
    Public Shared Function ComputeSHA512Hash(ByVal path As String) As String
        Using fs As New System.IO.FileStream(path, System.IO.FileMode.Open, System.IO.FileAccess.Read)
            Return ComputeSHA512Hash(fs)
        End Using
    End Function
    Public Shared Function ComputeSHA512Hash(ByVal stream As System.IO.Stream) As String
        Dim aHash() As Byte = New System.Security.Cryptography.SHA512Managed().ComputeHash(stream)
        Return System.Convert.ToBase64String(aHash)
    End Function

End Class
